<?php
e($this->element('post', compact('post')));
?>
<div id="respond">
<?php if($session->check('Auth.User')): ?>
	<h4>Respond with your comment (<?php e($html->link('Markdown', 'http://daringfireball.net/projects/markdown/syntax', array('target'=>'_blank'))); ?>-enabled)</h4>
	<?php
	e($form->create('Post', array('action' => 'respond')));
	e($form->input('Comment.content', array('type' => 'textarea', 'label' => 'Response')));
	e($form->hidden('Comment.post_id', array('value' => $this->params['pass'][0])));
	e($form->hidden('Comment.user_id', array('value' => $session->read('Auth.User.id'))));
	e($form->end('Respond'));
	?>
<?php else: ?>
	<p>You must be logged in to comment. <?php e($html->link('Log-in', '/admin/login')); ?>.</p>
<?php endif; ?>
</div>
<div id="comments">
	<h4>Comments</h4>
	<?php
	if(count($post['Comment'])){
		foreach($post['Comment'] as $comment){
			e($this->element('comment', compact('comment')));
		}
	}
	else{
		?>
		<p>There are no comments yet. <a href="#respond">Make your own!</a></p>
		<?php
	}
	?>	
</div>